package com.mxpio.erp.equipment.utils;


import org.apache.commons.lang3.RandomUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 填值规则Demo：生成订单号
 * 【测试示例】
 */
public class OrderNumberUtil {

    public static String getCode(String prefix){
      return   getCode(prefix, "yyyyMMddHHmmss");
    }
    public static String getCode(String prefix,String format){
        SimpleDateFormat format1 = new SimpleDateFormat(format);
        int random = RandomUtils.nextInt(1000,10000) ;
        String value = prefix + format1.format(new Date()) + random;
        return value;
    }
}
